﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Admin_MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["flag"] == null)//判断用户是否正常登录
            {
                Response.Redirect("../../Login.aspx");//没有正常登录则跳转到登录页
            }
            
        }
    }
   protected void btnDepartment_Click(object sender, EventArgs e)
    {
        string id = ((Button)sender).ID;//获取Button控件的ID
        switch (id)
        {
            //用户点击下面这些按钮对应的ID时将触发其Click事件链接到目标页并向目标页传一个值
            case "btnDepartment": DB.TYPE_SECTION = "部门"; break;
            case "btnPlace": DB.TYPE_SECTION = "仓库"; break;
            case "btnUnit": DB.TYPE_SECTION = "计量单位"; break;
            case "btnInType": DB.TYPE_SECTION = "入库类型"; break;
            case "btnOutType": DB.TYPE_SECTION = "出库类型"; break;
            case "btnMaterial": DB.TYPE_SECTION = "物资大类"; break;
            case "btnType": DB.TYPE_SECTION = "收付款方式"; break;
        }
        Response.Redirect("EditBigType.aspx");//跳转到目标页
    }

    protected void btnMatType_Click(object sender, EventArgs e)
    {
        DB.TYPE_SECTION = "物资类别";
        Response.Redirect("MaterialType.aspx");
    }
    protected void btnMatName_Click(object sender, EventArgs e)
    {
        DB.TYPE_SECTION = "物资信息";
        Response.Redirect("EditMaterial.aspx");
    }
    protected void btnEnterprise_Click(object sender, EventArgs e)
    {
        DB.TYPE_SECTION = "往来单位";
        Response.Redirect("EnterPrise.aspx");
    }
}
